﻿@page "/OvenUp"
@inject OvenServer ovenServer
@using System.ComponentModel
@using AntDesign.TableModels
@inject ModalService _modalService
@inject MessageService _message
<h3>烘箱进料</h3>
<div>
    <Row>
        <Col Span="24">请选择[满卷]缓存架</Col>
    </Row>
    <Row>
        <Col Span="24">
        <Select style="width:100%" DataSource="@DataList"
                AllowClear="true"
                ValueOnClear="@(0)"
                @bind-Value="@selet"
                ValueName="@nameof(Oven_Entity.Deviceid)"
                LabelName="@nameof(Oven_Entity.Remark)">
        </Select>
        </Col>
    </Row>
    <Row>
        <Col Span="24">
        <label>烘箱号</label>
        </Col>
    </Row>
    <Row>
        <Col Span="24">


        <Input style="width:100%" Placeholder="Basic usage" @bind-Value="@index" />
        </Col>
    </Row>
    <Row>
        <Col Span="24">
        <Button style="width:100%" Type="@ButtonType.Primary" @onclick="@Creat">确认进烘箱</Button>
        </Col>
    </Row>
</div>

@code {
    ObservableCollection<FullCache_Entity> DataList { get; set; } = new ObservableCollection<FullCache_Entity>();
    int selet { get; set; } = 0;
    int index { get; set; } = 0;


    protected override async Task OnInitializedAsync()
    {
        var Ovens = await ovenServer.GetFulllist();
        if (Ovens != null)
        {
            DataList.Clear();
            foreach (var item in Ovens)
            {
                DataList.Add(item);
            }
        }

        base.OnInitialized();
    }
    private async Task Creat()
    {
        _modalService.Confirm(new ConfirmOptions()
        {
            Title = "提示",
            Icon =@<Icon Type="exclamation-circle" Theme="Outline"></Icon>,
OkText = "确认",
OnOk = async (e) =>
{
int a = selet;
int c = index;
var aa = await ovenServer.TaskCreatOverUp(selet, index);
_message.Info(aa);
},
CancelText = "取消",
Content = "是否提交？",
});
}
}
